package dbcTools.base;

public class StrSeparatorStrs {
	private StringBuilder strSeparatorStrs;
	private String separator;

	public StrSeparatorStrs(String separator) {
		this.strSeparatorStrs = new StringBuilder();
		this.separator = separator;
	}

	public void setSeparator(String separator) {
		this.separator = separator;
	}

	public void link(String str) {
		this.strSeparatorStrs.append(str).append(this.separator);
	}

	public String getSql() {
		this.removeLastSeparator();
		return this.strSeparatorStrs.toString();
	}

	protected StringBuilder removeLastSeparator() {
		return this.strSeparatorStrs.delete(strSeparatorStrs.length() - separator.length(), strSeparatorStrs.length());
	}

	public void clearStrSeparatorStrs() {
		strSeparatorStrs.delete(0, strSeparatorStrs.length());
	}
}
